<script type="text/javascript" src="<?=PUBLICO?>graficos/HC2.3.2/js/highcharts.js"></script>

<script>
var chart;
var chart1;

$(document).ready(function() {
	chart = new Highcharts.Chart({
		chart: {
			renderTo: 'graf_status',
			plotBackgroundColor: null,
			plotBorderWidth: null,
			plotShadow: false
		},
		title: {
			text: '<?php echo $graf['1']['titulo'];?>'
		},
		tooltip: {
			formatter: function() {
				return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
			}
		},
		plotOptions: {
			pie: {
				allowPointSelect: true,
				cursor: 'pointer',
				dataLabels: {
					enabled: true
				},
				showInLegend: false,
				series: {
                			cursor: 'pointer',
							events: {
								click: function(event) {
									alert(this.name +' clicked\n'+
										  'Alt: '+ event.altKey +'\n'+
										  'Control: '+ event.ctrlKey +'\n'+
										  'Shift: '+ event.shiftKey +'\n');
								}
							}
				}
			}
            
		},
		series: [{
			type: 'pie',			
			data: [<?php $o = ''; foreach($graf['1']['itens'] as $k=>$v){$o .= ',[\''.$k.'\', '.$v.']';}; echo substr($o, 1);?>],
			name: '<?php echo $graf['1']['titulo'];?>'
		}]
	});

	
	// ===========================================================
	chart1 = new Highcharts.Chart({
					chart: {
						renderTo: 'graf_teste',
						defaultSeriesType: 'bar'
					},
					title: {
						text: 'Projetos por Área - 2012'
					},
					xAxis: {
						//categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
						categories: [<?php $o = ''; foreach($graf['3']['cat'] as $k=>$v){$o .= ',\''.$v.'\'';}; echo substr($o, 1);?>]
					},
					yAxis: {
						min: 0,
						title: {
							text: 'Total de Projetos'
						}
					},
					legend: {
						backgroundColor: '#FFFFFF',
						reversed: true
					},
					tooltip: {
						formatter: function() {
							return ''+
								 this.series.name +': '+ this.y +'';
						}
					},
//					plotOptions: {
//						series: {
//							stacking: 'normal'
//						}
//					},
					plotOptions: {
						bar: {
							dataLabels: {
								enabled: true
							}
						},
						series: {
							cursor: 'pointer',
							point: {
								events: {
									click: function() {
										location.href = this.options.url;
									}
								}
							}
						}
					},
					legend: {
						layout: 'vertical',
						align: 'right',
						verticalAlign: 'top',
						x: -100,
						y: 100,
						floating: true,
						borderWidth: 1,
						backgroundColor: '#FFFFFF',
						shadow: true
					},
					
					series: [{
						type: 'bar',			
						data: [<?php $o = ''; foreach($graf['3']['itens'] as $k=>$v){$o .= ','.$v.'';}; echo substr($o, 1);?>],
						name: 'Projetos'
					}]
		
					

				});
	
	
	
	
});

</script>


<div id="graf_status" style=" float:left; width: 450px; height: 300px;"></div>
<div id="graf_teste" style=" float:left; width: 600px; height: 300px;"></div>